package com.meihua.shellapp.activity.personalcenter;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.meihua.shellapp.R;
import com.meihua.shellapp.activity.webview.WebActivity;
import com.meihua.shellapp.base.BaseActivity;
import com.meihua.shellapp.base.MyApplication;
import com.meihua.shellapp.utils.URL;

import butterknife.Bind;

/**
 * 作者：lc on 2017/9/28.
 * 邮箱：lc0607live@163.com
 */

public class RewardMechanismActivity extends BaseActivity {

    @Bind(R.id.iv_top_left)
    ImageView iv_top_left;//返回
    @Bind(R.id.tv_title)
    TextView tv_title;//标题
    @Bind(R.id.rl_service)
    RelativeLayout rl_service;//长期服务奖
    @Bind(R.id.rl_rule)
    RelativeLayout rl_rule;//基本法规则
    @Bind(R.id.rl_bonus)
    RelativeLayout rl_bonus;//奖金系数

    @Override
    public int getLayoutId() {
        return R.layout.activity_reward_mechanism;
    }

    @Override
    public void initView(Bundle savedInstanceState) {
        iv_top_left.setVisibility(View.VISIBLE);
        iv_top_left.setOnClickListener(this);
        tv_title.setVisibility(View.VISIBLE);
        tv_title.setText("奖励机制");

        rl_service.setOnClickListener(this);
        rl_rule.setOnClickListener(this);
        rl_bonus.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        Intent in = new Intent();
        switch (view.getId()) {
            case R.id.rl_bonus://奖金系数
                in.setClass(mContext, WebActivity.class);
                in.putExtra("url", URL.getUrl().WEBBONUS + MyApplication.getInstance().getUserId());
                startActivity(in);
                break;
            case R.id.rl_service://长期服务奖
                in.setClass(mContext, WebActivity.class);
                in.putExtra("url", URL.getUrl().WEBSERVICE);
                startActivity(in);
                break;
            case R.id.rl_rule://基本法规则
                in.setClass(mContext, WebActivity.class);
                in.putExtra("url", URL.getUrl().WEBRULE);
                startActivity(in);
                break;
        }
    }
}
